<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:65:"F:\yxl\tp5.com\public/../application/index\view\index\upload.html";i:1560410483;s:56:"F:\yxl\tp5.com\application\index\view\layout\header.html";i:1560410387;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout 后台大布局 - Layui</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        /*分页*/
        .pagination {}

        .pagination li {display: inline-block;margin-right: -1px;padding: 7px;border: 1px solid #e2e2e2;min-width: 20px;margin-top:20px;text-align: center;}

        .pagination li.active {background: #009688;color: #fff;border: 1px solid #009688;}

        .pagination li a {display: block;text-align: center;}

        a{
            color: #FF00FF;
        }

        table{
            margin-top:30px;
            text-align:center;
        }

        select{
            text-align:center;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">layui 后台布局</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>

            <li class="layui-nav-item layui-this">
                <a href="javascript:;">功能</a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('/index/index/img'); ?>">轮播图</a></dd>
                    <dd><a href="<?php echo url('/index/index/flow'); ?>">流加载</a></dd>
                    <dd><a href="<?php echo url('/index/index/send_sms'); ?>">手机号验证</a></dd>
                    <dd><a href="<?php echo url('/index/index/send_mail'); ?>">php邮箱验证</a></dd>
                </dl>
            </li>

            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>

        <ul class="layui-nav layui-layout-right">
            <a style="color:red">欢迎<?php echo $user; ?></a>
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    岳晓雷
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="<?php echo url('index/login/loginout'); ?>">该退了</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">列表页面</a>
                    <dl class="layui-nav-child">
                        <dd><a href="<?php echo url('auth/index'); ?>">角色列表</a></dd>
                        <dd><a href="<?php echo url('jquery/jlist'); ?>">地区列表</a></dd>
                        <dd><a href="<?php echo url('nav/index'); ?>">图片列表</a></dd>
                        <dd><a href="<?php echo url('index/UserList/userlist'); ?>">管理员列表</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">列表添加</a>
                    <dl class="layui-nav-child">
                        <dd><a href="http://tp5.com/index/index/add">添加标题</a></dd>
                        <dd><a href="<?php echo url('userlist/addUser'); ?>">添加管理员</a></dd>
                        <dd><a href="<?php echo url('Jquery/add'); ?>">添加地区用户</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="http://tp5.com/index/index/upload">图片上传</a></li>
                <li class="layui-nav-item"><a href="<?php echo url('Chat/ChatList'); ?>">聊天室</a></li>
                <li class="layui-nav-item"><a href="<?php echo url('Jquery/nav'); ?>">无限级分类</a></li>
                <li class="layui-nav-item"><a href="<?php echo url('Jquery/Treeview'); ?>">树型菜单</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!--内容主体区域-->
        <!--<div style="padding: 15px;">内容主体区域</div>-->
        <table class="layui-hide" id="demo" lay-filter="test"></table>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域

    </div>
</div>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script src="/static/layui/layui.js"></script>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>指定允许上传的文件类型</legend>
        </fieldset>

        <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>
        <div class="layui-upload-list">
            <img class="layui-upload-img" id="demo1">
            <p id="demoText"></p>
        </div>
        <!--<p id="demoText"></p>-->
        <button type="button" class="layui-btn layui-btn-primary" id="test4"><i class="layui-icon"></i>只允许压缩文件</button>
        <div class="layui-upload-list">
            <img class="layui-upload-img" id="demo2">
            <p id="demoText1"></p>
        </div>
        <button type="button" class="layui-btn" id="test5"><i class="layui-icon"></i>上传视频</button>
        <button type="button" class="layui-btn" id="test6"><i class="layui-icon"></i>上传音频</button>
        <div style="margin-top: 10px;">

        <!-- 示例-970 -->
        <ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>

        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域

    </div>
</div>
<script src="/static/layui/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('upload', function(){
        var $ = layui.jquery,upload = layui.upload;
    });
</script>
<script>
    //var upload = layui.upload;
    //指定允许上传的文件类型
    layui.use(['upload','jquery'], function(){
        var upload = layui.upload;
        var jquery = layui.jquery;
        upload.render({
        elem: '#test3'
        ,url: "<?php echo url('index/uploadLayui'); ?>"
        ,auto: true
        ,accept: 'file' //普通文件
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    jquery('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            ,done:function (res,index,upload){
                console.log(res);
                jquery('#file').attr('value',res.data);
            }
        });
        upload.render({ //允许上传的文件后缀
        elem: '#test4'
        ,url: "<?php echo url('index/uploadLayui'); ?>"
        ,accept: 'file' //普通文件
        ,exts: 'zip|rar|7z' //只允许上传压缩文件
        ,auto: true
        ,before: function(obj){
            //预读本地文件示例，不支持ie8
            obj.preview(function(index, file, result){
                jquery('#demo2').attr('src', result); //图片链接（base64）
            });
        }
        ,done:function (res,index,upload){
            console.log(res);
            jquery('#file').attr('value',res.data);
        }
        });
        upload.render({
        elem: '#test5'
        ,url: "<?php echo url('index/uploadLayui'); ?>"
        ,accept: 'video' //视频
        ,done: function(res,index,upload){
            console.log(res)
        }
        });
        upload.render({
        elem: '#test6'
        ,url: "<?php echo url('index/uploadLayui'); ?>"
        ,accept: 'audio' //音频
        ,done: function(res,index,upload) {
            console.log(res)
        }
        });
    });
</script>
</body>
</html>